package org.com.creationalPattern.abstractFactory;

/**
 * @author Jonny
 * @version 1.0
 * @Description:
 * @date 2021/4/14 13:19
 */
public class ClientDemo {
    public static void main(String[] args) {
        //定义两个工厂
        AbstractFactory factory1=new ConcreteFactory1();
        AbstractFactory factory2=new ConcreteFactory2();
        //生产等级为1的产品A
        ProductA a1=factory1.factoryA();
        //生成等级为2的产品A
        ProductA a2=factory2.factoryA();

        //生产等级为1的产品B
        ProductB b1=factory1.factoryB();
        ProductB b2=factory2.factoryB();

        a1.method1();
        a2.method1();
        b1.method1();
        b2.method1();

    }
}
